﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace AsycServer
{
    public partial class AsyUdpServer
    {
        List<Client> disconnectedList = new List<Client>(), connectedList = new List<Client>();
        List<Client> clientList = new List<Client>();
        public Client GetClient(int id)
        {
            foreach (Client c in clientList)
            {
                if (c.ID == id)
                {
                    return c;
                }
            }
            return null;
        }

        public Client GetClient(IPEndPoint ip)
        {
            foreach (Client c in clientList)
            {
                if (c.udpAdress != null && c.udpAdress.Equals(ip))
                {
                    return c;
                }
            }
            return null;
        }
    }
}
